package com.example.testrxjava.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.testrxjava.R;
import com.example.testrxjava.fragment.project.ProjectInfoBean;
import com.example.testrxjava.util.ImageUtil;

import java.util.List;

/**
 * 项目名称：TestRxjava
 *
 * @Author 郭迎辉
 * Create by 11:51 on 2019/4/22.
 * Describe:
 */
public class ProjectInfoAdapter extends BaseQuickAdapter<ProjectInfoBean.DataBean.DatasBean, BaseViewHolder> {


    public ProjectInfoAdapter(int layoutResId, @Nullable List<ProjectInfoBean.DataBean.DatasBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ProjectInfoBean.DataBean.DatasBean item) {
        if(item==null){
            return;
        }
        helper.setText(R.id.projectTitleTv,item.getTitle())
                .setText(R.id.projectDecsTv,item.getDesc())
                .setText(R.id.projectAuthorTv,item.getAuthor())
                .setText(R.id.projectDateTv,item.getNiceDate());

        ImageUtil.loadImage(mContext, (ImageView) helper.getView(R.id.projectPicIv),item.getEnvelopePic());


    }
}
